<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org" lang="en">

<head th:replace="fragments/headTag :: headTag">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>QuDEx Repository Tools - Collections Manager</title>

<!-- Bootstrap -->
<link
	href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.css"
	th:href="@{/webjars/bootstrap/3.0.3/css/bootstrap.css}"
	rel="stylesheet" />
<link href="../../../resources/css/navbar.css"
	th:href="@{/resources/css/navbar.css}" rel="stylesheet" />
<!-- JQuery -->
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"
	th:src="@{/webjars/jquery/1.9.0/jquery.min.js}"></script>
<script
	src="http://netdna.bootstrapcdn.com/twitter-bootstrap/3.0.3/js/bootstrap.min.js"
	th:src="@{/webjars/bootstrap/3.0.3/js/bootstrap.min.js}"></script>

<!-- Spring JS and Ajax -->
<script type="text/javascript" th:src="@{/resources/dojo/dojo.js}"></script>
<script type="text/javascript" th:src="@{/resources/spring/Spring.js}"></script>
<script type="text/javascript"
	th:src="@{/resources/spring/Spring-Dojo.js}"></script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
</head>
<body>
	<div class="container">
		<div th:include="fragments/bodyHeader :: bodyHeader" th:remove="tag">This
			is the navigation bar here</div>
		<ol class="breadcrumb">
			<li th:text="#{breadcrumbs.process.relations1}">Add QuDEx
				relations</li>
			<li th:text="#{breadcrumbs.process.relations2}">Collection
				selection</li>
			<li class="active" th:text="#{breadcrumbs.process.relations3}">Relations
				management</li>
		</ol>
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 th:text="#{relationView.relManagement.title}"
					class="panel-title">QuDEx Relationships management</h3>
			</div>
			<div class="panel-body">
				<div>
					<p th:if="${filesList.size() != 0}"
						th:text="#{relationView.relManagement.text}">Add relationships
						between files in your collection...</p>
					<p th:unless="${filesList.size() != 0}"
						th:text="#{relationView.relManagement.text1}">The collection
						does not contain any file.</p>
				</div>
				<form id="form-collection" th:action="${flowExecutionUrl}"
					th:object="${filesModel.relationObject}"
					method="post" th:role="form" class="form-inline">
					<div th:if="${filesList.size() != 0}" class="form-group">
						<label class="sr-only" for="rel1">The file</label>
						<select id="rel1" th:field="*{subjectRelation}"
							class="form-control" size="10">
							<option th:with="element=${file.split(';')}"
								th:each="file : ${filesList}" th:value="${element[0]}"
								th:title="${element[1]}" th:text="${element[1]}">the
								file title</option>
						</select>
					</div>
					<div th:if="${filesList.size() != 0}" class="form-group">
						<select th:field="*{relationName}" style="width: 175px;"
							class="form-control">
							<option selected="selected" value="isReferencedBy">isReferencedBy</option>
							<option value="isRelatedTo">isRelatedTo</option>
							<option value="isVersionOf">isVersionOf</option>
							<option value="isAnnotationOf">isAnnotationOf</option>
							<option value="isDocumentationOf">isDocumentationOf</option>
							<option value="isFormatOf">isFormatOf</option>
						</select>
					</div>
					<div th:if="${filesList.size() != 0}" class="form-group">
						<label class="sr-only" for="rel2">The file</label>
						<select id="rel2" th:field="*{objectRelation}"
							size="10"
							class="form-control">
							<option th:with="element=${file.split(';')}"
								th:each="file : ${filesList}" th:value="${element[0]}"
								th:title="${element[1]}" th:text="${element[1]}">the
								file title</option>
						</select>
					</div>
					<div th:if="${filesList.size() != 0}" class="form-group">
						<input name="_eventId_addRelation"
							class="btn btn-primary" type="submit"
							th:value="#{relationView.relManagement.form.submit}" 
							value="Add Relation" />
					</div>
					<div class="form-group">
						<input name="_eventId_cancelSelect" class="btn btn-danger"
							type="submit"
							th:value="#{relationView.relManagement.form.cancel}" 
							value="Cancel" />
						</div>
					<div class="form-group">
						<input name="_eventId_finish" class="btn btn-primary" type="submit"
							th:value="#{relationView.relManagement.form.finish}" 
							value="Finish" />
					</div>
				</form>
				<br />
				<a href="#" 
					data-toggle="collapse" 
             		data-target="#collapseOne">* More relationship information
					(show/hide)</a>
				<div id="collapseOne" th:utext="#{relationView.relManagement.text2}" class="panel-collapse collapse">
        			<div class="panel-body">
					<b>Description of the different relationships</b>
					<ul>
						<li><b>isLinkedTo</b>, to express relationships between
							documents</li>
						<li><b>isRelatedTo</b>, generic relationship between
							documents.</li>
						<li><b>isVersionOf</b>, usually to express that a document is
							a version of another document, i.e. drafts</li>
						<li><b>isAnnotationOf</b>, useful when a document contains a
							description of another document, similar to a memo</li>
						<li><b>isReferencedBy</b>, useful when relating a document
							which refers to a publication that is referenced in another
							document</li>
						<li><b>isFormatOf</b>, useful when relating a transcription
							with its associated source audio file</li>
					</ul>
					</div>
				</div>
			</div>
		</div>
		<div id="footer" th:include="fragments/footer :: footer"></div>
	</div>
</body>
</html>